﻿using System;

namespace SimpleLibraryClasses
{
    /// <summary>
    /// Enumeration of the different types of devices
    /// </summary>
    public enum DeviceType
    {
        Laptop,
        Desktop,
        TV,
        Projector,
        Monitor,
        Phone,
        Peripheral
    }

    [Serializable()]
    public class Device : Item
    {
        public Device() : base() 
        {
        }
        
        /// <summary>
        /// The device's unique serial number
        /// </summary>
        public String Serial { get; set; }

        /// <summary>
        /// The model or model number for this device
        /// </summary>
        public String Model { get; set; }

        /// <summary>
        /// The name or brief description of the device
        /// </summary>
        public String DeviceName { get; set; }

        /// <summary>
        /// The type of device
        /// </summary>
        public DeviceType DeviceType { get; set; }

        public override bool IsValid()
        {
            if (String.IsNullOrEmpty(this.Serial))
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        /// <summary>
        /// Return a short description of the device
        /// </summary>
        public override string DisplayName
        {
            get { return this.DeviceName; }
        }
    }
}
